From: Matthieu Gallien Date: Wed, 4 Dec 2024 17:33:24 +0000 (+0100) Subject: dehydrate placeholder files using CfDehydratePlaceholder X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~30^2^2~194^2 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=ae0203c462ee6085cdd0f7b12a11bf8328fbdfae;p=nextcloud-desktop.git dehydrate placeholder files using CfDehydratePlaceholder might be enough to get this working reliably Signed-off-by: Matthieu Gallien --- diff --git a/src/libsync/vfs/cfapi/cfapiwrapper.cpp b/src/libsync/vfs/cfapi/cfapiwrapper.cpp index ed214b88f..c1d13479f 100644 --- a/src/libsync/vfs/cfapi/cfapiwrapper.cpp +++ b/src/libsync/vfs/cfapi/cfapiwrapper.cpp @@ -906,19 +906,15 @@ OCC::Result OCC::CfApiWrapper::de const auto info = findPlaceholderInfo(path); if (info) { - CF_FILE_RANGE dehydrationRange; - dehydrationRange.StartingOffset.QuadPart = 0; - dehydrationRange.Length.QuadPart = size; - - const qint64 result = CfUpdatePlaceholder(handleForPath(path).get(), - nullptr, - fileIdentity.data(), - sizeToDWORD(fileIdentitySize), - &dehydrationRange, - 1, - CF_UPDATE_FLAG_MARK_IN_SYNC | CF_UPDATE_FLAG_DEHYDRATE, - nullptr, - nullptr); + LARGE_INTEGER largeStart, largeSize; + largeStart.QuadPart = 0; + largeSize.QuadPart = size; + + const qint64 result = CfDehydratePlaceholder(handleForPath(path).get(), + largeStart, + largeSize, + CF_DEHYDRATE_FLAG_NONE, + 0); if (result != S_OK) { const auto errorMessage = createErrorMessageForPlaceholderUpdateAndCreate(path, "Couldn't update placeholder info");